package com.kikikeji.weizhuo.manager;

import com.kikikeji.weizhuo.data.AppInfo;
import com.kikikeji.weizhuo.Launcher;

import java.lang.ref.WeakReference;
import java.util.ArrayList;

/**
 * Created by zhang on 2016/12/2.
 */
public class LauncherPresenter  {
    private static final String TAG = "LauncherPresenter";
    private final CustomViewManager mViewManager;

    private Launcher mLauncher;
    private final AllAppManager mAllAppManager;
    private final HideAppManager mHideAppManager;

    public LauncherPresenter(Launcher launcher) {
        WeakReference<Launcher> weakReference = new WeakReference<Launcher>(launcher);
        mLauncher = weakReference.get();

        mAllAppManager = new AllAppManager(mLauncher);
        mHideAppManager = new HideAppManager(mLauncher,mAllAppManager);
        mViewManager = new CustomViewManager(mLauncher,mHideAppManager);
    }

    public void doubleClick() {
       mViewManager.doubleClick();

    }

    public void bindAllApplications(ArrayList<AppInfo> apps) {
        mAllAppManager.setAllApps(apps);
    }
}
